import os
import time

### 运行版本标识
TAG = time.strftime('%Y%m%d%H%M%S', time.localtime())

### 工程目录
BASE_DIR = os.path.abspath(__file__).rsplit(os.sep, 3)[0]

### 本地调试用True，服务端跑测试任务为False
DEBUG = True
TEST_IP = '181.181.0.41'
TEST_PORT = 81
HUB_IP = '181.181.0.156'
HUB_PORT = 5555

### 默认账号密码
ACCOUNT = 'gosun'
PASSWORD = '123456'

### 文件目录
DATA_DIR = os.path.join(BASE_DIR, 'data')
LIB_DIR = os.path.join(BASE_DIR, 'lib')
LOG_DIR = os.path.join(BASE_DIR, 'log')
REPORTS_DIR = os.path.join(BASE_DIR, 'report')
SCREENSHOT_DIR = os.path.join(BASE_DIR, 'screenshot')
SRC_DIR = os.path.join(BASE_DIR, 'src')
JS_DIR = os.path.join(os.path.join(SRC_DIR, 'common'), 'js')

### 本地chromedriver路径
CHROME_DRIVER = os.path.join(LIB_DIR, 'chromedriver74.exe')

### hub中chrome浏览器属性
CHROME_CAPABILITIES = {
    "browserName": "chrome",
    "version": "",
    "platform": "ANY",
    "javascriptEnabled": True,
    "webdriver.chrome.driver": os.path.join(LIB_DIR, 'chromedriver')
}

### 登录元素的xpath
LOGIN_ACCOUNT_XPATH = "//*[@id='app']/div/div[2]/div/form/div[1]/div/div[2]/input"
LOGIN_PASSWORD_XPATH = "//*[@id='app']/div/div[2]/div/form/div[2]/div/div[2]/input"
LOGIN_BUTTON_XPATH = "//*[@id='app']/div/div[2]/div/form/div[4]/div/button"